#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include<QListWidget>
#include<QStackedWidget>
#include<QCloseEvent>
#include<QProgressBar>
#include"friend.h"
#include"filesystem.h"
#include<QWidget>
#include"fileprogressbar.h"
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    Friend *getFriend();
    FileSystem*getFileSystem();
    void setTitle(QString name);
    void closeEvent(QCloseEvent *event) override;

    //设置底部状态栏消息
    void setStatusBarMsg(const QString&text);
    //设置进度条显示信息
    void setProgressBarTip(const QString&text);
    //设置上传文件进度条值
    void setProgressValue(int value);

    //显示进度条
    void showProgressBar();

    //隐藏进度条
    void hideProgressBar();

    //设置关闭按钮使能
    void setCloseEnabled(bool flag);

    //登录设置
    void logInSet();
public slots:
    //设置目标文件按钮状态
    void setTargetStatus(bool status);

signals:
    void backToLogIn();

private slots:
    void on_actionFriendSystem_triggered();

    void on_actionFileSystem_triggered();

    void on_actionFileBack_triggered();

    void on_actionFileNewFolder_triggered();

    void on_actionFileFiUpload_triggered();

    void on_actionFileDownloadFile_triggered();

    void on_actionFileDelete_triggered();

    void on_actionFileRename_triggered();

    void on_actionFileMove_triggered();

    void on_actionTargetFile_triggered();

    void on_actionRefresh_triggered();

    void on_actionPrivateChat_triggered();

    void on_actionDeleteFriend_triggered();

    // void on_actionViewOnlineUsrs_triggered();

    void on_actionSearchUsr_triggered();

    void on_actionMesBroadCast_triggered();

    void on_actionexit_triggered();

    void on_actionlogOff_triggered();

    void on_actionFriendSystem_hovered();

    void on_actionFileSystem_hovered();

    void on_actionFileBack_hovered();

    void on_actionRefresh_hovered();

    void on_actionFileNewFolder_hovered();

    void on_actionFileFiUpload_hovered();

    void on_actionFileDownloadFile_hovered();

    void on_actionFileDelete_hovered();

    void on_actionFileRename_hovered();

    void on_actionFileMove_hovered();

    void on_actionTargetFile_hovered();

    void on_actionexit_hovered();

    void on_actionlogOff_hovered();

    void on_actionPrivateChat_hovered();

    void on_actionDeleteFriend_hovered();

    // void on_actionViewOnlineUsrs_hovered();

    void on_actionSearchUsr_hovered();

    void on_actionMesBroadCast_hovered();


    void on_actionShareFile_triggered();

    void on_actionShareFile_hovered();

    void on_actionupdateUsrMes_triggered();

    void on_actionupdateUsrMes_hovered();

private:
    Ui::MainWindow *ui;

    Friend *m_friend;
    FileSystem *m_fileSystem;

    FileProgressBar *m_progressBar;
};

#endif // MAINWINDOW_H
